import request from '@/utils/request'

// 查询博客文章列表
export function listArticle(query) {
  return request({
    url: '/admin/article/list',
    method: 'get',
    params: query
  })
}

// 查询博客文章详细
export function getArticle(id) {
  return request({
    url: '/admin/article/' + id,
    method: 'get'
  })
}

// 新增博客文章
export async function addArticle(data) {
  return await request({
    url: '/admin/article',
    method: 'post',
    data: data
  })
}

// 修改博客文章
export async function updateArticle(data) {
  return await request({
    url: '/admin/article',
    method: 'put',
    data: data
  })
}

// 删除博客文章
export function delArticle(id) {
  return request({
    url: '/admin/article/' + id,
    method: 'delete'
  })
}

// 上传图片
export function uploadImage(data) {
  return request({
    url: '/admin/article/uploadImage',
    method: 'post',
    data: data
  })
}
// 获取七牛云token
export function getToken() {
  return request({
    url: '/admin/article/getToken',
    method: 'get',

  })
}

